<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
	
	<ui:composition template="template/template.xhtml">
		<ui:define  name="page-title" >#{messages.home}</ui:define >
		<ui:define  name="center">
			<h:outputText styleClass="title" value="Alertas"/>
        	<p:messages id="messages" autoUpdate="true" showSummary="true"/> 
			<p:dataTable id="tabelaStock" var="stock" value="#{homeController.alertasStock}"  
		                 paginator="true" rows="10"  paginatorPosition="bottom"
		                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} "  
		                 rowsPerPageTemplate="5,10,15">  
		        
		        <p:column>  
		            <f:facet name="header">  
		                <h:outputText value="#{messages.id}" />  
		            </f:facet>  
		            <h:outputText value="#{stock.id}" />  
		        </p:column>  
		        
		        <p:column>  
		            <f:facet name="header">  
		                <h:outputText value="#{messages.deposito}" />  
		            </f:facet>  
		            <h:outputText value="#{stock.deposito.nome}" />  
		        </p:column>
		        
		        <p:column>  
		            <f:facet name="header">  
		                <h:outputText value="#{messages.material}" />  
		            </f:facet>  
		            <h:outputText value="#{stock.material.nome}" />  
		        </p:column>  
		  
		  		<p:column>  
		            <f:facet name="header">  
		                <h:outputText value="#{messages.limite}" />  
		            </f:facet>  
		            <h:outputText value="#{stock.material.limite}" />  
		        </p:column>
		  
		        <p:column>  
		            <f:facet name="header">  
		                <h:outputText value="#{messages.quantidade}" />  
		            </f:facet>  
		            <h:outputText value="#{stock.quantidade}" />  
		        </p:column>  
		  
		        <p:column>  
		            <f:facet name="header">  
		                <h:outputText value="#{messages.dataActualizacao}" />  
		            </f:facet>  
		            <h:outputText value="#{stock.dataActualizacao}">
		            	<f:convertDateTime pattern="#{messages.dateTimeFormat}" />
		            </h:outputText>
		        </p:column> 
			</p:dataTable>
		</ui:define >
	</ui:composition>
	
</html>